package com.esgpro.esg_api.util;

import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public class DateUtil {

    public String getDate() {
        Date date = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        System.out.println("当前日期为：" + dateFormat.format(date));
        return dateFormat.format(date);
    }

    public String getAccountDate() {
        Date date = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("MMdd");
        return dateFormat.format(date);
    }
}
